<?php
class TextPNG 
{
	var $font = 'Arial'; //default font. directory relative to script directory.
	var $msg = "no text"; // default text to display.
	var $size = 10; // default font size.
	var $rot = 0; // rotation in degrees.
	var $pad = 0; // padding.
	var $transparent = 1; // transparency set to on.
	var $red = 0; // black text...
	var $grn = 0;
	var $blu = 0;
	var $bg_red = 255; // on white background.
	var $bg_grn = 255;
	var $bg_blu = 255;
	var $f_red = 0;
	var $f_grn = 0;
	var $f_blu = 0;
	function draw() 
	{
	
		$width  = ImageFontWidth($this->size) *strlen($this->msg);
		$height = ImageFontHeight($this->size) + 1;
		$im = @imagecreatetruecolor ($width,$height);
		$bg = imagecolorallocate($im, 255, 255, 255);
		imagefill($im, 0, 0, $bg);
		$textcolor = imagecolorallocate($im, $this->f_red, $this->f_grn, $this->f_blu);
		imagestring($im, 5, 0, 3, $this->msg, $textcolor);
		imagepng($im, NULL, 8);
		imagedestroy($im);
		}
	}
?>